package com.ruoyi.paipan.common;

import com.ruoyi.paipan.utils.LunarUtil;

import java.util.Arrays;
import java.util.List;

public class NineStar {
    private int index;
    public static List<String> NUMBER = Arrays.asList("一", "二", "三", "四", "五", "六", "七", "八", "九");
    public static List<String> COLOR = Arrays.asList("白", "黒", "碧", "绿", "黄", "白", "赤", "白", "紫");
    public static List<String> WU_XING = Arrays.asList("水", "土", "木", "木", "土", "金", "金", "土", "火");
    public static List<String> POSITION = Arrays.asList("坎", "坤", "震", "巽", "中", "乾", "兑", "艮", "离");
    public static List<String> NAME_BEI_DOU = Arrays.asList("天枢", "天璇", "天玑", "天权", "玉衡", "开阳", "摇光", "洞明", "隐元");
    public static List<String> NAME_XUAN_KONG = Arrays.asList("贪狼", "巨门", "禄存", "文曲", "廉贞", "武曲", "破军", "左辅", "右弼");
    public static List<String> NAME_QI_MEN = Arrays.asList("天蓬", "天芮", "天冲", "天辅", "天禽", "天心", "天柱", "天任", "天英");
    public static List<String> BA_MEN_QI_MEN = Arrays.asList("休", "死", "伤", "杜", "", "开", "惊", "生", "景");
    public static List<String> NAME_TAI_YI = Arrays.asList("太乙", "摄提", "轩辕", "招摇", "天符", "青龙", "咸池", "太阴", "天乙");
    public static List<String> TYPE_TAI_YI = Arrays.asList("吉神", "凶神", "安神", "安神", "凶神", "吉神", "凶神", "吉神", "吉神");
    public static List<String> SONG_TAI_YI = Arrays.asList("门中太乙明，星官号贪狼，赌彩财喜旺，婚姻大吉昌，出入无阻挡，参谒见贤良，此行三五里，黑衣别阴阳。", "门前见摄提，百事必忧疑，相生犹自可，相克祸必临，死门并相会，老妇哭悲啼，求谋并吉事，尽皆不相宜，只可藏隐遁，若动伤身疾。", "出入会轩辕，凡事必缠牵，相生全不美，相克更忧煎，远行多不利，博彩尽输钱，九天玄女法，句句不虚言。", "招摇号木星，当之事莫行，相克行人阻，阴人口舌迎，梦寐多惊惧，屋响斧自鸣，阴阳消息理，万法弗违情。", "五鬼为天符，当门阴女谋，相克无好事，行路阻中途，走失难寻觅，道逢有尼姑，此星当门值，万事有灾除。", "神光跃青龙，财气喜重重，投入有酒食，赌彩最兴隆，更逢相生旺，休言克破凶，见贵安营寨，万事总吉同。", "吾将为咸池，当之尽不宜，出入多不利，相克有灾情，赌彩全输尽，求财空手回，仙人真妙语，愚人莫与知，动用虚惊退，反复逆风吹。", "坐临太阴星，百祸不相侵，求谋悉成就，知交有觅寻，回风归来路，恐有殃伏起，密语中记取，慎乎莫轻行。", "迎来天乙星，相逢百事兴，运用和合庆，茶酒喜相迎，求谋并嫁娶，好合有天成，祸福如神验，吉凶甚分明。");
    public static List<String> LUCK_XUAN_KONG = Arrays.asList("吉", "凶", "凶", "吉", "凶", "吉", "凶", "吉", "吉");
    public static List<String> LUCK_QI_MEN = Arrays.asList("大凶", "大凶", "小吉", "大吉", "大吉", "大吉", "小凶", "小吉", "小凶");
    public static List<String> YIN_YANG_QI_MEN = Arrays.asList("阳", "阴", "阳", "阳", "阳", "阴", "阴", "阳", "阴");

    public NineStar(int index) {
        this.index = index;
    }


    public static NineStar fromIndex(int index)
    {
        return new NineStar(index);
    }

    public String getNumber()
    {
        return NineStar.NUMBER.get(index);
    }

    public String getColor()
    {
        return NineStar.COLOR.get(index);
    }

    public String getWuXing()
    {
        return NineStar.WU_XING.get(index);
    }

    public String getPosition()
    {
        return NineStar.POSITION.get(index);
    }

    public String getPositionDesc()
    {
        return LunarUtil.POSITION_DESC .get(getPosition());
    }

    public String getNameInXuanKong()
    {
        return NineStar.NAME_XUAN_KONG.get(index);
    }

    public String getNameInBeiDou()
    {
        return NineStar.NAME_BEI_DOU.get(index);
    }

    public String getNameInQiMen()
    {
        return NineStar.NAME_QI_MEN.get(index);
    }

    public String getNameInTaiYi()
    {
        return NineStar.NAME_TAI_YI.get(index);
    }

    public String getLuckInQiMen()
    {
        return NineStar.LUCK_QI_MEN.get(index);
    }

    public String getLuckInXuanKong()
    {
        return NineStar.LUCK_XUAN_KONG.get(index);
    }

    public String getYinYangInQiMen()
    {
        return NineStar.YIN_YANG_QI_MEN.get(index);
    }

    public String getTypeInTaiYi()
    {
        return NineStar.TYPE_TAI_YI.get(index);
    }

    public String getBaMenInQiMen()
    {
        return NineStar.BA_MEN_QI_MEN.get(index);
    }

    public String getSongInTaiYi()
    {
        return NineStar.SONG_TAI_YI.get(index);
    }

    public int getIndex()
    {
        return index;
    }

    @Override
    public String toString()
    {
        return getNumber() + getColor() + getWuXing() + getNameInBeiDou();
    }


    public String toFullString()
    {
        String s = getNumber();
        s += getColor();
        s += getWuXing();
        s += " ";
        s += getPosition();
        s += "(";
        s += getPositionDesc();
        s += ") ";
        s += getNameInBeiDou();
        s += " 玄空.get(";
        s += getNameInXuanKong();
        s += " ";
        s += getLuckInXuanKong();
        s += ") 奇门.get(";
        s += getNameInQiMen();
        s += " ";
        s += getLuckInQiMen();
        if (!getBaMenInQiMen().isEmpty()) {
            s += " ";
            s += getBaMenInQiMen();
            s += "门";
        }
        s += " ";
        s += getYinYangInQiMen();
        s += ") 太乙.get(";
        s += getNameInTaiYi();
        s += " ";
        s += getTypeInTaiYi();
        s += ")";
        return s;
    }

    public static void main(String[] args) {
        System.out.printf("sss");
    }
}
